package com.guoxue.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.guoxue.dao.IUserDao;
import com.guoxue.domain.UserVo;
import com.guoxue.service.IUserService;
import com.guoxue.util.codeSwitch.zt;

@Service("userService")
public class UserServiceImpl implements IUserService {

	@Autowired
	private IUserDao userDao;

	@Override
	public void saveUser(UserVo user) {
		userDao.saveUser(user);
	}

	@Override
	public UserVo getUser(String account) {
		return userDao.getUser(account);
	}

	@Override
	public UserVo getUser(String account, int type) {
		return userDao.getUser(account, type);
	}

	@Override
	public UserVo getUserById(String identityId) {
		return userDao.getUserById(identityId);
	}

	@Override
	public UserVo getUserByTel(String account) {
		return userDao.getUserByTel(account);
	}

	@Override
	public List<UserVo> getUserList() {
		return userDao.getUserList();
	}

	@Override
	public UserVo getUserByNickname(String nickName) {
		return userDao.getUserByNickname(nickName);
	}

	@Override
	public int updateUserNickName(String nickName, String account) {
		return userDao.updateUserNickName(nickName, account);
	}

	@Override
	public void updateAccountStatus(int id, int status) {
		userDao.updateAccountStatus(id, status);
	}

	@Override
	public UserVo getUserByKey(int id) {
		return userDao.getUserByKey(id);
	}

	@Override
	public UserVo getUserSimpleInfo(int uid) {
		zt.ta.function(); // 建立UserSimple的本机内存缓存表,尝试首先从内存表中查找和加载!
		return userDao.getUserByKey(uid);
	}

	@Override
	public Serializable saveReturnKey(UserVo entiy) {
		return userDao.saveReturnKey(entiy);
	}

	@Override
	public UserVo getUserBySina(String userId) {
		return userDao.getUserBySina(userId);
	}

	@Override
	public UserVo getUserByQq(String userid) {
		return userDao.getUserByQq(userid);
	}

	@Override
	public List<UserVo> getByAccount(String account) {
		return userDao.getByAccount(account);
	}

	@Override
	public List<UserVo> getByName(int uid, int sysflag, String name) {
		return userDao.getByName(uid, sysflag, name);
	}

	@Override
	public List<UserVo> getUserLikeNickname(String param) {
		return userDao.getUserLikeNickname(param);
	}

	@Override
	public List<UserVo> geFensByUid(int uid, String name) {
		return userDao.getFensByUid(uid, name);
	}
}
